<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>首页</title>
<link rel="stylesheet" href="../lib/layui/css/layui.css">
<link rel="stylesheet" href="../back/css/page.css" />
<link rel="stylesheet" href="../back/css/ext.css"/>
<script type="text/javascript" src="../back/js/jquery.min.js"></script>

<style type="text/css">
.wenzhang{
text-align: center;
height: 235px;
width: 230px;
margin-left: 10px;
padding-top: 100px;
}
.userName{
padding-top:50px;
margin-left: 40px;
}

</style>
</head>
 
<body>


	<div class="left">
		<div class="bigTitle">个人管理系统</div>
		<div class="lines">
			<div class="active">个人信息管理</div>
			<div class="yonghuguanli">用户管理</div>
			<c:if test="${fenlei!=null}">
				<c:forEach items="${fenlei}" var="tion">
					<div data-cid="${tion.cid}" class="page">${tion.cName}</div>
				</c:forEach>
			</c:if>
		</div>
	</div>
	<div class="top">
		<div class="leftTiyle" id="flTitle" name="">个人信息管理</div>
		<div class="thisUser">当前用户：${user.userCode}</div>
		
	</div>
	
	<div class="content" id="queryAllUsers" style="display:none;">
	<table id="queryAllUser" lay-filter="test"></table>
			<script type="text/html" id="barDemo1">
 		 <a class="layui-btn  layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
 		 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		<a class="layui-btn  layui-btn-xs" lay-event="roofs" id="roofsz">{{d.roof==0?'置顶':'取消'}}</a>
		</script>
	</div> 
	  
	<div class="content" id="management" style="display:none;">
			<table id="user" lay-filter="test"></table>
			<script type="text/html" id="chakanuser">
			 <a class="layui-btn layui-btn-xs" lay-event="chakanuser">查看用户文章</a>
			</script>
	</div>
	<div class="content" id="gerenxiangqing" style="display: none;">
		<form class="layui-form">
			<div class="layui-upload">
				<button type="button" class="layui-btn" id="test1">头像</button>
				<div class="layui-upload-list">
					<img class="layui-upload-img" id="demo1"
						src="${user.uimges}" style="height: 200px;width: 200px;">
					<input name="uimges" type="hidden" value="${user.uimges}">
					<p id="demoText"></p>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">用户名:</label>
				<div class="layui-input-block">
					<input type="text" name="userName" lay-verify="title"
						autocomplete="off" placeholder="请输入标题" class="layui-input" value="${user.userName}" >
				</div>
			</div>
			<input type="hidden" name="uid" value="${user.uid}">
			<input type="hidden" name="userCode" value="${user.userCode}">
			<input type="hidden" name="password" value="${user.password}">
			<button class="layui-btn layui-btn-radius" lay-submit
				lay-filter="userForm" style="float: right;" id="xiugaiyonghu">修改用户</button>
		</form>
	</div>
	<div class="content" id="gerenxinxi" style="display: block;">
		<div class="tou">
			<img src="${user.uimges}" width="150px" height="150px" class="imgs">
			<span class="userName"><h3>
					用户名:${user.userName}
					</h3></span>
			<button class="layui-btn layui-btn-primary"
				style="margin-left: 500px;margin-top: 50px;">
				<i class="layui-icon">修改</i>
			</button>
		</div>
		<c:if test="${fenlei!=null}">
			<c:forEach items="${fenlei}" var="tion">
				<div class="wenzhang">
					<span>${tion.cName}</span>
					<c:if test="${tion.cid==1}">
						<c:forEach begin="0" items="${countlist}" var="countContent"
							end="0">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==2}">
						<c:forEach begin="1" items="${countlist}" var="countContent"
							end="1">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==3}">
						<c:forEach begin="2" items="${countlist}" var="countContent"
							end="2">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==4}">
						<c:forEach begin="3" items="${countlist}" var="countContent"
							end="3">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
					<c:if test="${tion.cid==5}">
						<c:forEach begin="4" items="${countlist}" var="countContent"
							end="4">
							<span>${countContent}</span>
						</c:forEach>
					</c:if>
				</div>
			</c:forEach>
		</c:if>
	</div>
	<div class="content" id="qita" style="display: none;">
		<button class="layui-btn" id="layui-btn">添加按钮</button>
		<script type="text/javascript" src="../lib/layui/layui.js"></script>
		<script type="text/javascript" src="../lib/js/index.js"></script>
		<table id="demo" lay-filter="test"></table>
		<script type="text/html" id="barDemo">
 		 <a class="layui-btn  layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
 		 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		<a class="layui-btn  layui-btn-xs" lay-event="roof" id="roofsz">{{d.roof==0?'置顶':'取消'}}</a>
		</script>
	</div>
	<div class="contents" id="addContents" style="display: none;">
		<form class="layui-form">
			<div class="layui-form-item">
				<label class="layui-form-label">标题:</label>
				<div class="layui-input-block">
					<input type="text" name="tcontentheader" lay-verify="title"
						autocomplete="off" placeholder="请输入标题" class="layui-input" required>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">作者:</label>
				<div class="layui-input-block">
					<input type="text" name="author" lay-verify="title"
						autocomplete="off" placeholder="请输入作者" class="layui-input" required>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">分类:</label>
				<div class="layui-input-block">
					<select name="classification.cid" lay-filter="aihao" id="selectType">
						<c:forEach items="${fenlei}" var="tion">
							<option value="${tion.cid}" >${tion.cName}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<input type="hidden" name="tid">
			<div id="tcontent" style="margin-top: 160px;" ></div>

			<textarea id="text1" style="display: none;" name="tcontent"></textarea>
			<button class="layui-btn layui-btn-radius" lay-submit
				lay-filter="loginForm" style="float: right;" id="wenzhang" >文章提交</button>
		</form>

		<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script type="text/javascript"
			src="../back/wangEditor/wangEditor.min.js"></script>
			<script type="text/javascript" src="../back/js/ext.js"></script>
		<script type="text/javascript">
			var E = window.wangEditor
			var editor = new E('#tcontent')
			// 配置文件上传服务器端地址
			editor.customConfig.uploadImgServer = 'upload'
			editor.customConfig.uploadFileName = 'file'
			var $text1 = $('#text1')
		 editor.customConfig.onchange = function(html) {
				// 监控变化，同步更新到 textarea
				$text1.val(html)
			} 
			 editor.create()
			 E.viewSource.init(editor);		
		</script>
	</div>
	<script type="text/html" id="topTpl">
	<div>{{d.roof == 0 ? '未置顶' : '已置顶'}}</div>
    </script>
    
    <script type="text/javascript" src="../back/js/index.js"></script>
</body>

</html>